<template>
  <scrollMore class="hotdetail">
    <div class="flex f-j-c">
      <div class="left">
        <div class="hothuati">
          <div class="top">
            <img :src="hotdetail.pc_background_maps" alt="" />
            <div class="mao"></div>
            <div class="conetntop f-a-c f-j-sb-a-c">
              <span class="title">#{{ hotdetail.tags_name }}#</span>
            </div>
          </div>

          <div class="content f-d-c">
            <div class="contentjieshao f-a-c">
              <div class="leftconent">
                <img :src="hotdetail.head_portrait" alt="" />
              </div>
              <div class="coentndeta">
                <div class="conenntdata f-a-c">
                  <span>热度:{{ hotdetail.tags_number }}</span>
                </div>
              </div>
            </div>
            <div class="huatidetail">
              <span>{{ hotdetail.tag_introduce }}</span>
            </div>
          </div>

          <!-- 帖子列表 -->
          <commentList :list="list"></commentList>
        </div>
      </div>

      <communityRight
        :token="true"
        :friendcommunity="true"
        :user="true"
        :ercode="true"
      ></communityRight>
    </div>
  </scrollMore>
</template>

<script>
import scrollMore from "@/components/scrollMore.vue";
import commentList from "@/components/commentList.vue";
import { ElMessage } from "element-plus";
import communityRight from "../views/communityHome/communityRight.vue";
import { postsTagsv2, tagsInfo } from "@/axios/community.js";
import { useRouter } from "vue-router";
import {
  computed,
  defineComponent,
  onMounted,
  reactive,
  toRefs,
  getCurrentInstance,
  onUnmounted,
} from "vue";
import { useStore } from "vuex";
export default defineComponent({
  components: {
    communityRight,
    scrollMore,
    commentList
  },
  setup() {
    const router = useRouter();
    const { proxy } = getCurrentInstance();
    let store = useStore();
    let data = reactive({
      list: [], //帖子列表
      hotdetail: "", //话题详情
      page: 1, //页数
    });

    // 话题详情
    let gettagsDetail = () => {
      tagsInfo({ id: data.id }).then((res) => {
        data.hotdetail = res.data;
      });
    };

    // 根据话题id 获取帖子列表
    let getPostsTagsv2 = () => {
      postsTagsv2({
        id: data.id,
        page: data.page,
      }).then((res) => {
        data.list = res.data.data
      });
    };

    onMounted(() => {
      data.id = router.currentRoute._value.query.id;
      gettagsDetail(); //获取话题详情
      getPostsTagsv2(); //获取圈子帖子列表
    });
    onUnmounted(() => {});

    return {

      ...toRefs(data),
    };
  },
});
</script>
<style lang="scss" scoped>
.hotdetail {
  background-color: #f9f9f9;
  // padding-top: 10px;
  .left {
    margin-right: 10px;
    width: 800px;
    margin-top: 10px;

    .hothuati {
      height: 160px;
      .top {
        position: relative;
        width: 100%;
        height: 140px;
        > img {
          border-radius: 10px 10px 0 0;
          width: 100%;
          height: 100%;
        }
        .mao {
          border-radius: 10px;
          backdrop-filter: blur(8px); /* 模糊效果的强度，可以调整值 */
          position: absolute;
          top: 0;
          width: 100%;
          height: 100%;
        }
      }
    }
  }
}
.content {
  background-color: #fff;
  z-index: 1;
  position: relative;
  align-items: flex-start;
  padding: 0 20px;
  border-radius: 10px;
  .leftconent {
    margin-right: 20px;
    margin-top: -36px;
    > img {
      width: 72px;
      height: 72px;
      border-radius: 10px 10px 10px 10px;
      opacity: 1;
    }
  }
  .coentndeta {
    width: 100%;
  }
  .conenntdata {
    > span {
      font-size: 12px;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      font-weight: 400;
      color: #656f79;
      margin-right: 20px;
    }
  }
}
.conetntop {
  position: absolute;
  bottom: 0;
  padding: 0 20px 10px 112px;
  width: 100%;
  .title {
    display: block;
    font-size: 16px;
    font-family: Microsoft YaHei-Bold, Microsoft YaHei;
    font-weight: 700;
    color: #fff;
  }
  .huatibutt {
    > span {
      display: block;
      padding: 4px 12px;
      border-radius: 92px;
      background: linear-gradient(90deg, #9ed8e6 0%, #a1f0c0 100%);
      font-size: 14px;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      font-weight: 400;
      color: #ffffff;
      &:first-child {
        margin-right: 10px;
      }
    }
  }
}
.huatidetail {
  width: 100%;
  padding: 20px;
  > span {
    font-size: 14px;
    font-family: Microsoft YaHei-Regular, Microsoft YaHei;
    font-weight: 400;
    color: #000000;
    line-height: 30px;
  }
}






</style>
